CREATE TABLE [dbo].[PhotoSet](
	[PhotoSetId] [int] IDENTITY(1,1) NOT NULL,
	[PhotoSetTitle] [nvarchar](100) NULL,
	[PhotoSetDate] [datetime] NULL,
	[PhotoSetStarring] [varchar](100) NULL,
	[PhotoSetDescription] [varchar](max) NULL,
	[IsActive] [bit] NOT NULL,
 CONSTRAINT [PK_PhotoSet] PRIMARY KEY CLUSTERED 
(
	[PhotoSetId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

CREATE TABLE [dbo].[PhotoSetPhoto](
	[PhotoSetPhotoId] [int] IDENTITY(1,1) NOT NULL,
	[PhotoSetId] [int] NOT NULL,
	[PhotoSetPhotoFileName] [varchar](255) NOT NULL,
 CONSTRAINT [PK_PhotoSetPhoto] PRIMARY KEY CLUSTERED 
(
	[PhotoSetPhotoId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[PhotoSetPhoto]  WITH CHECK ADD  CONSTRAINT [FK_PhotoSetPhoto_PhotoSet] FOREIGN KEY([PhotoSetId])
REFERENCES [dbo].[PhotoSet] ([PhotoSetId])
ON DELETE CASCADE
GO

ALTER TABLE [dbo].[PhotoSetPhoto] CHECK CONSTRAINT [FK_PhotoSetPhoto_PhotoSet]
GO





